#include<iostream>
#include<string>
#include<cstdio>
#include<map>
using namespace std;
typedef long long LL;
const int N = 1e7 + 10;
int mp[N];
int n;
int main()
{
	cin >> n;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j < i; j++) {
			LL a = i * i - j * j;
			if (a <= n) {
				if (!mp[a]) {
					mp[a] = 1;
					ans++;
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}